<!DOCTYPE html>
<html lang="en">
<head th:include="certificateWeb/headFoot :: headerCss">
</head>
<!--<link href="/css/web/themes/about.css" rel="stylesheet">-->
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">

<body id="body">
<div th:include="certificateWeb/headFoot :: header"></div>
<main id="main">
    <section class="sec_1">
        <div class="div_1">
            <ul>
                <li class="this"><a href="/certificate/standardInfo">证书简介</a></li>
                <li><a href="/certificate/certificateInfo">标准信息</a></li>
                <li><a href="/certificate/gradeAnalyze">成绩分析</a></li>
            </ul>
        </div>

        <div class="div_2">
            <div class="div_00">
                <div id="news"></div>
                <div style="clear: both"></div>
                <div id="page"></div>
            </div>
        </div>
        <div style="clear: both"></div>
    </section>

</main>
<div th:include="certificateWeb/headFoot :: footer"></div>
</body>
<script>
    $(function () {
        $.ajax({
            url: "/certificate/standardInfoApi",
            data: {
                current: 1,
                number:5
            },
            success: function (res) {
                if(res.data.pages==0){
                    $("#news").html('<div class="noData">暂无数据</div>');
                }else{
                    var list = res.data.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        news += '<div class="title">'+item.name+'</div>'+
                            '<div class="span_1 b18"><span class="title_1">发证机构：</span><p class="title_2">'+item.organization+'</p></div>'+
                            '<div class="span_1 b18"><span class="title_1">证书简介：</span><p class="title_2">'+item.introduce+'</p></div><hr style="margin-bottom: 30px"/>';
                    });
                    $("#news").html(news);
                    page(1,res.data.pages);
                }
            }
        });
    });
    function page(num,tolPages) {
        $("#page").paging({
            nowPage:Number(num), // 当前页码
            pageNum:Number(tolPages), // 总页码
            buttonNum:10, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                $.ajax({
                    url: "/certificate/standardInfoApi",
                    type: 'GET',
                    data: {
                        current: num,
                        number: 5
                    },
                    success:function (res) {
                        // console.log(res);
                        var list = res.data.records;
                        var news = '';
                        list.forEach(function (item, index) {
                            news += '<div class="title">'+item.name+'</div>'+
                                '<div class="span_1 b18"><span class="title_1">发证机构：</span><p class="title_2">'+item.organization+'</p></div>'+
                                '<div class="span_1 b18"><span class="title_1">证书简介：</span><p class="title_2">'+item.introduce+'</p></div><hr style="margin-bottom: 30px"/>';
                        });
                        $("#news").html(news)
                    }
                });
            }
        });
    }

</script>
<script type="text/javascript" src="/js/xlPaging.js"></script>
</html>